import os
import cv2
import utils
from tqdm import tqdm


SrcDir = r"I:\Temp\Temp4\1"
DstDir = r""

for root, dirs, files in os.walk(SrcDir):
    for file in tqdm(files):
        if file[-1] == 'l':
            img = cv2.imread(root + "\\" + file[:-3] + "jpg")
            Infos = utils.ReadXml(root + "\\" + file)
            for Info in Infos:
                LabelImg = img[Info[1]:Info[3], Info[0]:Info[2]]
                cv2.imshow("test", LabelImg)
                cv2.waitKey(0)
